package DesignPatern.A07_原型模式.QSB.A02浅拷贝;

import java.util.ArrayList;

/**
 * @Author: Du
 * @Date: 2021/7/22 12:11
 * <p>
 * 浅拷贝
 */
public class Thing implements Cloneable
{
    private ArrayList<String> arrayList = new ArrayList<>();
    
    public void setValue(String value)
    {
        this.arrayList.add(value);
    }
    
    public ArrayList<String> getValue()
    {
        return this.arrayList;
    }
    
    @Override
    public Thing clone()
    {
        Thing thing = null;
        try
        {
            thing = (Thing) super.clone();
        } catch (CloneNotSupportedException e)
        {
            e.printStackTrace();
        }
        return thing;
    }
}
